﻿// See https://aka.ms/new-console-template for more information
using TaskDemo;

//Demo demo = new Demo();
//demo.TaskExceptionDemo1();

//Demo2 demo2 = new Demo2();
//demo2.CancelTaskDemo1();

Demo3 demo3 = new Demo3();
var TaskList = new List<Task>();
var task = Task.Run(() => demo3.ThreadDemo1());
var tas2 = Task.Run(() => demo3.TaskDemo2());
TaskList.Add(task);
TaskList.Add(tas2);
await Task.WhenAll(TaskList);